from my_shapes_fixed import Rectangle, Circle, Triangle
import math

def test_shapes():
    r = Rectangle(4,3)
    assert math.isclose(r.area(), 12.0)
    assert math.isclose(r.perimeter(), 14.0)

    c = Circle(2)
    assert math.isclose(c.area(), math.pi*4)
    assert math.isclose(c.perimeter(), 2*math.pi*2)

    t = Triangle(3,4,5)
    assert math.isclose(t.area(), 6.0)
    assert math.isclose(t.perimeter(), 12.0)

    print("所有测试通过！")

if __name__ == "__main__":
    test_shapes()